Re: [PHP] Strange Query Error...

On Sat, Nov 27, 2010 at 13:18, Don Wieland <donw [at] dwdataconcepts.com> wrote:
> On Nov 27, 2010, at 10:07 AM, Bastien wrote:
>
>> Try removing the backticks around the table names. If you do use them,
>> then all values (field names and table names) need it.
>
> I tried that and still chokes...
>
> select m.* from Members m inner join Member_Years my on m.aucciim_id =
> my.member_id where now() < DATE_ADD(DATE_SUB(concat(member_year +
> 1,'-07-01'), INTERVAL 1 DAY), INTERVAL 30 DAY) AND m.Preferred_First_Name
> LIKE 'Don%' group by m.AUCCIIM_ID order by m.preferred_last_name
>
> ERROR: You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> 'AND m.Preferred_First_Name LIKE 'Don%'' at line 1

Note how you keep changing case here. For example, m.aucciim_id
vs. m.AUCCIIM_ID. Also note that all of this is cAsE-sEnSiTiVe.

--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
daniel.brown [ Sa, 27 November 2010 19:44 ] [ ID #2050873 ]

Re: Strange Query Error...

--Apple-Mail-3--953932628
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit

On Nov 27, 2010, at 10:44 AM, Daniel P. Brown wrote:

> Note how you keep changing case here. For example, m.aucciim_id
> vs. m.AUCCIIM_ID. Also note that all of this is cAsE-sEnSiTiVe.

You are right. But it still chokes in PHP:

select m.* from Members m inner join Member_Years my on m.AUCCIIM_ID =
my.member_id where now() < DATE_ADD(DATE_SUB(concat(member_year +
1,'-07-01'), INTERVAL 1 DAY), INTERVAL 30 DAY) AND
m.Preferred_First_Name LIKE 'Don%' group by m.AUCCIIM_ID order by
m.preferred_last_name

Don
--Apple-Mail-3--953932628--
Don Wieland [ Sa, 27 November 2010 20:24 ] [ ID #2050874 ]

Re: [PHP-DB] Re: [PHP] Strange Query Error...

On Nov 27, 2010, at 1:24 PM, Don Wieland wrote:

> On Nov 27, 2010, at 10:44 AM, Daniel P. Brown wrote:
>
>> Note how you keep changing case here. For example, m.aucciim_id
>> vs. m.AUCCIIM_ID. Also note that all of this is cAsE-sEnSiTiVe.
>
> You are right. But it still chokes in PHP:
>
> select m.* from Members m inner join Member_Years my on
> m.AUCCIIM_ID = my.member_id where now() < DATE_ADD(DATE_SUB(concat
> (member_year + 1,'-07-01'), INTERVAL 1 DAY), INTERVAL 30 DAY) AND
> m.Preferred_First_Name LIKE 'Don%' group by m.AUCCIIM_ID order by
> m.preferred_last_name
>
> Don


Don't know if you necessarily need this but I found it while checking
to see if one letter names are a good idea in MySQL statements.
Might help in your like query.

http://techonthenet.com/sql/like.php

HTH,
Best,

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Karl DeSaulniers [ So, 28 November 2010 07:13 ] [ ID #2050901 ]
PHP » gmane.comp.php.database » Re: [PHP] Strange Query Error...

Vorheriges Thema: I have a question about MLM
Nächstes Thema: ON DUPLICATE KEY UPDATE